<!DOCTYPE html>
<html lang="en">
<title>兑换码新增记录-查看详情</title>
<#import "/layout/layout.html" as body/>
<@body.page>
<style>
    .ibox-footer h4 span {
        margin-right: 25px
    }
</style>

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <a href="to_cashcard_list"><h5 class="pull-left">兑换码列表</h5></a>
                   <h5 class="pull-left"> /兑换码充值详情</h5>
                </div>
                <div class="ibox-content">

                    <div class="table-responsive">
                        <form class="form-inline" action="to_cashcard_detail_view" role="form" id="form" method="post" accept-charset="UTF-8">
                            <div class="form-group">
                                <label for="storeName">用户ID：</label>
                                <input class="form-control" type="text" id="userId" name="userId" value="${userId!''}"/>
                            </div>
                            <input type="hidden" id="cashcard_id" name="cashcard_id" value="${cashcard_id!}">
                            <input type="hidden" id="pageNo" name="pageNo" value="${pageNo!}">
                            <div class="form-group">
                                <label for="storeName0">兑换时间：</label>
                                <div class="input-group date">
                                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                    <input type="text" class="form-control" id="makeTime" name="makeTime" value="${makeTime!}">
                                </div>
                            </div>
                            <button type="submit" class="btn btn-outline btn-primary" style="margin-top: 5px">确认</button>
                        </form>
                        <hr style="width: 100%">
                        <table class="table table-hover table-center dataTables-example">
                            <thead>
                            <tr>
                                <th>用户ID</th>
                                <th>用户昵称</th>
                                <th>兑换码</th>
                                <th>兑换方式</th>
                                <th>兑换时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            <#if listDetail??>
                            	<#list listDetail as list>
								<tr>
									<td>${list.userId!}</td>
									<td>${list.userInfo.nickName!}</td>
									<td>${list.cashcardCode!}</td>
									<td>
										<#if cashcardInfo.getMode = 1>
										 	用户输入
										</#if>
										<#if cashcardInfo.getMode = 2>
										 	系统生成
										</#if>
									</td>
									<td>${list.makeTime?datetime}</td>
								</tr>
								</#list>
                            </#if>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="ibox-footer overflow">
                    <h4 class="pull-left">
                        批次ID：<span>${cashcardInfo.id?string('000000')}</span>
                        名称：<span>${cashcardInfo.cashcardName!}</span>
                        生成数量：<span>${cashcardInfo.maxCount!}</span>
                        激活数量：<span>${cashcardInfo.getedCount!}</span>
                    </h4>
                    <div id="copot-page" class="pull-right"></div>
                </div>
                <div class="">
                	<a href="to_cashcard_list"><button class="btn btn-outline btn-primary">返回列表页</button></a>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="${baseUrl}js/main.js"></script>
<script>
    $(document).ready(function () {
        $('.input-group.date').datepicker({
            todayBtn: "linked",
            keyboardNavigation: false,
            forceParse: false,
            //calendarWeeks: true,
            autoclose: true,
            format: 'yyyy-mm-dd',
        });
        //导出excel
        ExampleFile("用户excel");
        //分页
        new Page({
            parent: $("#copot-page"),
            nowPage: ${pageNo!1},
            pageSize: 10,
            totalCount: ${pageCount!},
            setting: {
                defaultPage: 7,//默认显示可点击分页的个数
                firstPageText: "首页",
                prevPageText: "上一页",
                nextPageText: "下一页",
                lastPageText: "尾页"
            },
            callback: function (nowPage, totalPage) {
            	 $("#pageNo").val(nowPage);
                 $("#form").submit();
            }
        });
        
    });
</script>
</@body.page>
</html>